{template 'member', 'header'}
<script type="text/javascript">
<!--
	$(function() {
		$.formValidator.initConfig({
			autotip : true,
			formid : "myform",
			onerror : function(msg) {
			}
		});
		$("#price").formValidator({
			onshow : "请输入要充值的金额",
			onfocus : "充值金额不能为空"
		}).inputValidator({
			min : 1,
			max : 999,
			onerror : "充值金额不能为空"
		}).regexValidator({
			regexp : "^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){1,2})?$",
			onerror : "充值金额必须为整数或小数(保留两位小数)"
		});
		$("#contactname").formValidator({
			onshow : "请输入姓名",
			onfocus : "姓名不能为空"
		}).inputValidator({
			min : 1,
			max : 999,
			onerror : "姓名不能为空"
		});
		$("#email").formValidator({
			onshow : "请输入email",
			oncorrect : "格式正确"
		}).regexValidator({
			regexp : "email",
			datatype : "enum",
			onerror : "错误的emai格式"
		});
		$("#code").formValidator({
			onshow : "请输入验证码",
			onfocus : "验证码不能为空"
		}).inputValidator({
			min : 1,
			max : 999,
			onerror : "验证码不能为空"
		}).ajaxValidator({
			type : "get",
			url : "api.php",
			data : "controller=checkcode&action=check",
			datatype : "html",
			async : 'false',
			success : function(data) {
				if (data == 1) {
					return true;
				} else {
					return false;
				}
			},
			buttons : $("#dosubmit"),
			onerror : "验证码错误",
			onwait : "验证中"
		});
	})
//-->
</script>
<div id="memberArea">
	{template 'member', 'left'}
	<div class="col-auto">
		<div class="col-1 ">
			<h6 class="title">在线充值</h6>
			<div class="content">
				{if isset($_GET['exchange']) && $_GET['exchange']=='point'}
				<div class="point" id='exchange'>
					<a href="javascript:hide_element('exchange');" hidefocus="true" class="close"><span>关闭</span></a>
					<div class="content">
						<BR>
						<p>1、您可以通过充值人民币，然后进行积分兑换的方式获取积分</p>
						<p>2、您可以通过回复评论来获取积分</p>
					</div>
					<span class="o1"></span><span class="o2"></span><span class="o3"></span><span class="o4"></span>
				</div>
				{/if}
				<form name="myform" action="{SITE_URL}index.php?app=payment&controller=paycenter&action=recharge" method="post" id="myform">
					<table width="100%" cellspacing="0" class="table_form">
						<tr>
							<th width="80">余额：</th>
							<td style="padding: 0 0 0 10px"><font style="color: #F00; font-size: 22px; font-family: Georgia, Arial; font-weight: 700">{$memberinfo['amount']}</font> 元</td>
						</tr>
						<tr>
							<th>充值金额：</th>
							<td><input name="money" type="text" id="price" size="8" value="{if is_numeric($_GET['money'])}{$_GET['money']}{/if}" class="input-text">&nbsp;元<span id="msgid"></span></td>
						</tr>
						<tr>
							<th>充值方式：</th>
							<td>{if $payment}{mk_pay_btn($payment)}{else}本站暂未开启在线支付功能，如需帮助请联系管理员。{/if}</td>
						</tr>
						<tr>
							<td></td>
							<td colspan="2"><label> <input type="submit" name="dosubmit" id="dosubmit" value="确 定" class="btn btn-primary btn-sm"/>
							</label></td>
						</tr>
					</table>
				</form>
			</div>
			<span class="o1"></span><span class="o2"></span><span class="o3"></span><span class="o4"></span>
		</div>
	</div>
</div>
<script type="text/javascript">
	$(function() {
		$(".payment-show").each(function(i) {
			if (i == 0) {
				$(this).addClass("payment-show-on");
			}
			$(this).click(function() {
				$(this).addClass("payment-show-on");
				$(this).siblings().removeClass("payment-show-on");
			})
		});

	})
</script>
{template 'member', 'footer'}
